import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/layout'
Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      component: resolve => require(['@/views/Login'], resolve)
    },{
      path: '/index',
      component: Layout,
      hidden: true,
      name: '首页',
      children: [
        {
          path: '',
          component: (resolve) => require(['@/views/statistics/index'], resolve),
        }
      ]
    },{
      path: '/ErrorPage',
      component: resolve => require(['@/views/ErrorPage'], resolve)
    },
    {
      path: '/sys',
      component: Layout,
      hidden: true,
      name:'系统管理',
      children: [
        {
          path: 'dict',
          component: (resolve) => require(['@/views/system/dict/index'], resolve),
          name: '系统配置',
        },{
          path: 'account',
          component: resolve => require(['@/views/system/user/index'], resolve),
          name: '系统用户',
        },{
          path: 'log',
          component: resolve => require(['@/views/system/log/index'], resolve),
          name: '操作日志',
        },{
          path: 'limit',
          component: resolve => require(['@/views/system/limit/index'], resolve),
          name: '权限管理',
        },{
          path: 'role',
          component: resolve => require(['@/views/system/role/index'], resolve),
          name: '角色管理',
        },{
          path: 'pwd',
          component: resolve => require(['@/views/system/pwd/index'], resolve),
          name: '修改密码',
        },{
          path: 'banner',
          component: resolve => require(['@/views/system/banner/index'], resolve),
          name: '轮播管理',
        },{
          path: 'rolePrice',
          component: resolve => require(['@/views/system/rolePrice/index'], resolve),
          name: '角色商品价目',
        },{
          path: 'userPrice',
          component: resolve => require(['@/views/system/userPrice/index'], resolve),
          name: '用户商品价目',
        },
        {
          path: 'scottKey',
          component: resolve => require(['@/views/system/scottKey/index'], resolve),
          name: '高德Key管理',
        }
      ]
    }, {
      path: '/product',
      component: Layout,
      hidden: true,
      name:'商品管理',
      children: [
        {
          path: 'type',
          component: (resolve) => require(['@/views/product/type/index'], resolve),
          name: '商品类型',
        }, {
          path: 'list',
          component: (resolve) => require(['@/views/product/list/index'], resolve),
          name: '商品列表',
        },
      ]
    },{
      path: '/warehouse',
      component: Layout,
      hidden: true,
      name: '仓库管理',
      children: [
        {
          path: 'data',
          component: (resolve) => require(['@/views/warehouse/relationship/index'], resolve),
          name: '数据管理',
        },
        {
          path:'orderLog',
          component: (resolve) => require(['@/views/warehouse/orderLog/index'], resolve),
          name: '订单日志',
        },
        {
          path:'productLog',
          component: (resolve) => require(['@/views/warehouse/productLog/index'], resolve),
          name: '商品日志',
        },
        {
          path:'management',
          component: (resolve) => require(['@/views/warehouse/management/index'], resolve),
          name: '管理员',
        },{
          path: 'delivery',
          component: (resolve) => require(['@/views/warehouse/delivery/index'], resolve),
          name: '配送员',
        },
        {
          path:'shipment',
          component: (resolve) => require(['@/views/warehouse/shipment/index'], resolve),
          name: '出货单管理',
        },{
          path: 'purchase',
          component: (resolve) => require(['@/views/warehouse/purchase/index'], resolve),
          name: '进货单管理',
        },{
          path: 'replace',
          component: (resolve) => require(['@/views/warehouse/replace/index'], resolve),
          name: '换货单管理',
        },{
          path: 'recovery',
          component: (resolve) => require(['@/views/warehouse/recovery/index'], resolve),
          name: '回收单管理',
        },{
          path: 'commodity',
          component: (resolve) => require(['@/views/warehouse/commodity/index'], resolve),
          name: '仓库商品管理',
        },
        {
          path: 'inventOrder',
          component: (resolve) => require(['@/views/warehouse/inventOrder/list/index'], resolve),
          name: '盘点单管理',
        },
        {
          path: 'brokenOrder',
          component: (resolve) => require(['@/views/warehouse/brokenOrder/index'], resolve),
          name: '破损单管理',
        }
      ]
    },{
      path: '/user',
      component: Layout,
      hidden: true,
      name:'用户管理',
      children: [
        {
          path: 'list',
          component: (resolve) => require(['@/views/user/list/index'], resolve),
          name: '用户列表',
        },{
          path: 'address',
          component: (resolve) => require(['@/views/user/address/index'], resolve),
          name: '收货地址',
        },{
          path: 'product',
          component: (resolve) => require(['@/views/user/product/index'], resolve),
          name: '用户商品',
        },
        {
          path: 'message',
          component: (resolve) => require(['@/views/user/message/index'], resolve),
          name: '用户消息',
        },{
          path: 'log',
          component: (resolve) => require(['@/views/user/log/index'], resolve),
          name: '商品记录',
        }
      ]
    },{
      path: '/order',
      component: Layout,
      hidden: true,
      name:'订单管理',
      children: [
        {
          path: 'list',
          component: (resolve) => require(['@/views/order/list/index'], resolve),
          name: '待支付订单',
        },
        {
          path: 'unpaidList',
          component: (resolve) => require(['@/views/orderUnpaid/list/index'], resolve),
          name: '待付款订单',
        },
        {
          path: 'completeList',
          component: (resolve) => require(['@/views/orderComplete/list/index'], resolve),
          name: '已完成订单',
        },
        {
          path: 'changeOrder',
          component: (resolve) => require(['@/views/changeOrder/list/index'], resolve),
          name: '变更订单',
        },
        {
          path: 'reserve',
          component: (resolve) => require(['@/views/reserve/list/index'], resolve),
          name: '用户预约单',
        },
        {
          path: 'productReturn',
          component: (resolve) => require(['@/views/refund/productReturn/index'], resolve),
          name: '退货订单',
        },
        {
          path: 'refundBucket',
          component: (resolve) => require(['@/views/refundBucket/list/index'], resolve),
          name: '退桶单',
        }
      ]
    },
    {
      path: '/statisticalDetail',
      component: Layout,
      hidden: true,
      name:'数据明细',
      children: [
        {
          path: 'purchaseList',
          component: (resolve) => require(['@/views/statisticalDetail/purchaseList/index'], resolve),
          name: '进货单明细',
        },
        {
          path: 'shipmentList',
          component: (resolve) => require(['@/views/statisticalDetail/shipmentList/index'], resolve),
          name: '出货单明细',
        },
        {
          path: 'userOrderList',
          component: (resolve) => require(['@/views/statisticalDetail/userOrderList/index'], resolve),
          name: '用户订单明细',
        },
        {
          path: 'recoveryList',
          component: (resolve) => require(['@/views/statisticalDetail/recoveryList/index'], resolve),
          name: '回收单明细',
        },
        {
          path: 'deliveryList',
          component: (resolve) => require(['@/views/statisticalDetail/deliveryList/index'], resolve),
          name: '配送单明细',
        },
        {
          path: 'productOrderList',
          component: (resolve) => require(['@/views/statisticalDetail/productOrderList/index'], resolve),
          name: '订单商品明细',
        }
      ]
    },
  ]
})
